package s14;

import net.sf.cglib.core.Signature;
import net.sf.cglib.proxy.InterfaceMaker;
import org.objectweb.asm.Type;

/**
 * Interface Maker用来创建一个新的Interface
 *
 * @author wangpp
 */
public class InterfaceMakerTest {
    public static void main(String[] args) {
        Signature s = new Signature("foo", Type.DOUBLE_TYPE, new Type[]{Type.INT_TYPE});
        InterfaceMaker interfaceMaker = new InterfaceMaker();
        interfaceMaker.add(s, new Type[0]);

        Class iFoo = interfaceMaker.create();
        System.out.println(iFoo.getMethods().length);

        System.out.println(iFoo.getMethods()[0].getName());
        System.out.println(iFoo.getMethods()[0].getReturnType());

    }
}
